<?php

// 适配器模式

// 统一接口
interface PrefectMan
{
	function cook();
	function writerphp();
}
// 基础类
class Wife
{
	function cook()
	{
		echo '我会做满汉全席<br/ >';
	}
}
// 实现接口
class Man implements PrefectMan
{
	protected $wife;

	function __construct($wife)
	{
		$this->wife = $wife;
	}

	function cook()
	{
		$this->wife->cook();
	}

	function writerphp()
	{
		echo '我会写PHP代码 <br />';
	}
}

$wife = new Wife();
$man = new Man($wife);

$man->cook();
$man->writerphp();
